<html>
<head><meta charset="utf-8"><title>rust-analyzer in gnome-builder · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html">rust-analyzer in gnome-builder</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192127090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192127090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192127090">(Mar 28 2020 at 15:03)</a>:</h4>
<p>Hello everybody! :)<br>
Has anyone of you tested rust-analyzer with gnome-builder yet?</p>



<a name="192127946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192127946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192127946">(Mar 28 2020 at 15:25)</a>:</h4>
<p>It doesn't seem to support LSP</p>



<a name="192128011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192128011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192128011">(Mar 28 2020 at 15:26)</a>:</h4>
<p><a href="https://wiki.gnome.org/Projects/Vala/Tools#Language_Server_Protocol_Support" title="https://wiki.gnome.org/Projects/Vala/Tools#Language_Server_Protocol_Support">https://wiki.gnome.org/Projects/Vala/Tools#Language_Server_Protocol_Support</a> or maybe it does?</p>



<a name="192128087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192128087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192128087">(Mar 28 2020 at 15:28)</a>:</h4>
<p>There's no way to configure which server to use</p>



<a name="192128344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192128344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192128344">(Mar 28 2020 at 15:34)</a>:</h4>
<p>I tried to make it <a href="https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/master/src/plugins/rls/rls_plugin.py#L133" title="https://gitlab.gnome.org/GNOME/gnome-builder/-/blob/master/src/plugins/rls/rls_plugin.py#L133">spawn</a> <code>rust-analyzer</code> instead of <code>rls</code>, but it's not working</p>



<a name="192128902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192128902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192128902">(Mar 28 2020 at 15:47)</a>:</h4>
<p>I haven't looked into it too deeply, but it looks like it's trying to load my entire <code>~</code>, and it also panics a little from time to time. Using the wrong path is definitely a problem, though.</p>



<a name="192129136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192129136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192129136">(Mar 28 2020 at 15:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192128087" title="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192128087">said</a>:</p>
<blockquote>
<p>There's no way to configure which server to use</p>
</blockquote>
<p>Yeah it looks like they have a plugin for rls, but no generalized use whatever language server you want support.</p>



<a name="192129319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192129319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192129319">(Mar 28 2020 at 15:57)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> does <code>RUST_LOG=gen_lsp_server=trace</code> still work? and does it log to <code>stderr</code>?</p>



<a name="192129683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192129683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192129683">(Mar 28 2020 at 16:05)</a>:</h4>
<p>Filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/3758" title="https://github.com/rust-analyzer/rust-analyzer/issues/3758">https://github.com/rust-analyzer/rust-analyzer/issues/3758</a>.</p>



<a name="192130496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192130496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192130496">(Mar 28 2020 at 16:25)</a>:</h4>
<p>I guess that would be for the gnome-builder team to decide, but - from your perspective - would it make more sense to have generalized any language server support in builder, or a toggle on the rls plugin to switch between (legacy)rls and rust-analyzer?</p>



<a name="192131401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131401">(Mar 28 2020 at 16:47)</a>:</h4>
<p>I don't know. They seem to prefer having different plugins (e.g. <code>gcc</code> and <code>clang</code>). The <code>rust-analyzer</code> one could be pretty much identical to the RLS plugin. Or maybe they'll do nothing and wait until <code>rust-analyzer</code> replaces RLS (if that ever happens).</p>



<a name="192131488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131488">(Mar 28 2020 at 16:49)</a>:</h4>
<p>Gee, I wonder what's the best way to intercept the <code>stdout</code> and <code>stderr</code> of a running program.</p>



<a name="192131662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131662">(Mar 28 2020 at 16:52)</a>:</h4>
<p>You could use <a href="https://github.com/nelhage/reptyr" title="https://github.com/nelhage/reptyr"><code>reptyr</code></a>. It uses ptrace to make the target process perform the necessary steps to change its pty.</p>



<a name="192131678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131678">(Mar 28 2020 at 16:52)</a>:</h4>
<p>More details how it works here: <a href="https://blog.nelhage.com/2011/02/changing-ctty/" title="https://blog.nelhage.com/2011/02/changing-ctty/">https://blog.nelhage.com/2011/02/changing-ctty/</a></p>



<a name="192131719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131719">(Mar 28 2020 at 16:54)</a>:</h4>
<p>I tried to use it once to recover a backgrounded program, but it didn't work for me. And I don't want to steal the fds, but rather eavesdrop on them</p>



<a name="192131783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131783">(Mar 28 2020 at 16:54)</a>:</h4>
<p>I usually <code>strace</code> the process, but it's a bit awkward when someone else spawns it</p>



<a name="192131825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131825">(Mar 28 2020 at 16:55)</a>:</h4>
<p>I had to use it once when Xorg crashed due to a failing GPU. It worked fine for me.</p>



<a name="192131921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131921">(Mar 28 2020 at 16:57)</a>:</h4>
<p>It seems to use <code>dup2</code>, so I guess it's not what I'm looking for</p>



<a name="192131966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192131966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192131966">(Mar 28 2020 at 16:58)</a>:</h4>
<p><a href="https://unix.stackexchange.com/questions/58550/how-to-view-the-output-of-a-running-process-in-another-bash-session/308666#308666" title="https://unix.stackexchange.com/questions/58550/how-to-view-the-output-of-a-running-process-in-another-bash-session/308666#308666">https://unix.stackexchange.com/questions/58550/how-to-view-the-output-of-a-running-process-in-another-bash-session/308666#308666</a></p>
<blockquote>
<p>tail -f /proc/&lt;pid&gt;/fd/1</p>
</blockquote>
<p>Maybe that works?</p>



<a name="192132013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192132013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192132013">(Mar 28 2020 at 16:59)</a>:</h4>
<blockquote>
<p>This won't work if the output is going to a tty (or redirected to /dev/null) — it will only work if the output is redirected to a file.</p>
</blockquote>
<p>Maybe not</p>



<a name="192132080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192132080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192132080">(Mar 28 2020 at 17:00)</a>:</h4>
<div class="codehilite"><pre><span></span>tail: cannot open &#39;/proc/67363/fd/1&#39; for reading: No such device or address
</pre></div>



<a name="192132122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192132122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192132122">(Mar 28 2020 at 17:01)</a>:</h4>
<p>The other suggestions on that page are using strace and then parsing the output</p>



<a name="192132178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192132178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192132178">(Mar 28 2020 at 17:02)</a>:</h4>
<p>Sounds like a fun project</p>



<a name="192132249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192132249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192132249">(Mar 28 2020 at 17:04)</a>:</h4>
<p>One of the snippets on the page worked:</p>
<div class="codehilite"><pre><span></span>strace -e <span class="nv">trace</span><span class="o">=</span>write -s1000 -fp <span class="nv">$pid</span> <span class="m">2</span>&gt;<span class="p">&amp;</span><span class="m">1</span> <span class="se">\</span>
<span class="p">|</span> grep --line-buffered -o <span class="s1">&#39;&quot;.\+[^&quot;]&quot;&#39;</span> <span class="se">\</span>
<span class="p">|</span> grep --line-buffered -o <span class="s1">&#39;[^&quot;]\+[^&quot;]&#39;</span> <span class="se">\</span>
<span class="p">|</span> <span class="k">while</span> <span class="nb">read</span> -r line<span class="p">;</span> <span class="k">do</span>
  <span class="nb">printf</span> <span class="s2">&quot;%b&quot;</span> <span class="nv">$line</span><span class="p">;</span>
<span class="k">done</span>
</pre></div>



<a name="192137184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192137184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192137184">(Mar 28 2020 at 19:07)</a>:</h4>
<p>I ended up writing a small program that logs the console IO and passes it through to a child process, but I still can't figure out what the issue is <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="192138287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192138287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192138287">(Mar 28 2020 at 19:35)</a>:</h4>
<p>Does it send any LSP requests at all or do you not make it that far? We don't check a lot of client caps so I could see us returning newer things than are supported by gnome builder</p>



<a name="192138337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192138337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192138337">(Mar 28 2020 at 19:37)</a>:</h4>
<p>It does, but we crash with an OOB access when converting the position: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/3758#issuecomment-605501732" title="https://github.com/rust-analyzer/rust-analyzer/issues/3758#issuecomment-605501732">https://github.com/rust-analyzer/rust-analyzer/issues/3758#issuecomment-605501732</a></p>



<a name="192138338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192138338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192138338">(Mar 28 2020 at 19:37)</a>:</h4>
<p>Not sure why</p>



<a name="192138399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192138399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192138399">(Mar 28 2020 at 19:38)</a>:</h4>
<p>I tried to debug it, but the CodeLLDB breakpoints don't seem to work on my system</p>



<a name="192138606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192138606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192138606">(Mar 28 2020 at 19:45)</a>:</h4>
<p>Can you try in vscode and see what the LSP is?</p>



<a name="192139190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139190">(Mar 28 2020 at 20:01)</a>:</h4>
<p>Not easily :-)</p>



<a name="192139265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139265">(Mar 28 2020 at 20:03)</a>:</h4>
<p>I tried it out on your example and it always sends the entire file contents in the <code>didChange</code>. That's the only different I see in that particular request/response</p>



<a name="192139522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139522">(Mar 28 2020 at 20:10)</a>:</h4>
<p>ahhh I think the gnome builder lsp client isn't respecting the server's choice of full text synchronization</p>



<a name="192139535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139535">(Mar 28 2020 at 20:11)</a>:</h4>
<p>And maybe we take the text from the request instead of our version, so it only has one character</p>



<a name="192139575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139575">(Mar 28 2020 at 20:12)</a>:</h4>
<p>Yeah I think that's probably the issue</p>



<a name="192139772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192139772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192139772">(Mar 28 2020 at 20:17)</a>:</h4>
<p>Maybe we should support partial synchronization</p>



<a name="192140487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192140487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192140487">(Mar 28 2020 at 20:35)</a>:</h4>
<p><span class="user-mention" data-user-id="278750">@bronze alibi</span> do you want to give it a try?</p>



<a name="192141319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141319">(Mar 28 2020 at 20:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192140487" title="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192140487">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="278750">bronze alibi</span> do you want to give it a try?</p>
</blockquote>
<p>try what?</p>



<a name="192141386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141386">(Mar 28 2020 at 21:00)</a>:</h4>
<p>Implementing incremental text synchronization support in <code>rust-analyzer</code>. Right now it expects editors to send the full file contents on each edit, but there's a mode where the editor can send only the differences.</p>



<a name="192141463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141463">(Mar 28 2020 at 21:03)</a>:</h4>
<p>I think it's a matter of passing the edits through a couple of layers of method calls, then actually applying them. You'd also need to do a line/column -&gt; byte offset conversion, not sure exactly where.</p>



<a name="192141468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141468">(Mar 28 2020 at 21:03)</a>:</h4>
<p>I am not familiar with the rust-analyzer codebase and a one university semester coder, so I am not sure I could pull that off.</p>



<a name="192141585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141585">(Mar 28 2020 at 21:06)</a>:</h4>
<p>If you want to take a look, you can start from <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/main_loop.rs#L598-L599" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/main_loop.rs#L598-L599">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/main_loop.rs#L598-L599</a>. <code>params.content_changes</code> contains all the changes, but the code only picks one and passes it through. Changes look <a href="https://docs.rs/lsp-types/0.73.0/lsp_types/struct.TextDocumentContentChangeEvent.html" title="https://docs.rs/lsp-types/0.73.0/lsp_types/struct.TextDocumentContentChangeEvent.html">like this</a>, where an empty range means that the full file needs to be replaced. There's a conversion from <code>Range</code> to a <code>rust-analyzer</code> <code>TextRange</code> in <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/conv.rs#L205" title="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/conv.rs#L205">conv.rs</a>. And <code>TextRange</code> is a pair of byte offsets, so that's what you need to pass through.</p>



<a name="192141744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192141744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192141744">(Mar 28 2020 at 21:11)</a>:</h4>
<p>I appreciate your helpfulness and I will take a look at it, but I am quite certain that this is quite far beyond my level of understanding.<br>
I think it would make a lot of sense for you to copy the text your wrote on what to do to the github issue, so someone else too can have an easier time, too.</p>



<a name="192142079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192142079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192142079">(Mar 28 2020 at 21:20)</a>:</h4>
<p>Sure, filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/3762" title="https://github.com/rust-analyzer/rust-analyzer/issues/3762">https://github.com/rust-analyzer/rust-analyzer/issues/3762</a>.</p>



<a name="192142214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192142214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bronze alibi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192142214">(Mar 28 2020 at 21:24)</a>:</h4>
<p>Cool. I really appreciate this community here. A one sentence question that could have reasonably been just met with just a "no", let to 3 people responding with a little cooperative investigation and 2 issues filed.<br>
This is work too, and I thank y'all for taking the time!</p>



<a name="192142381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192142381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192142381">(Mar 28 2020 at 21:29)</a>:</h4>
<p>Well, it looks like Code sends an update on each keypress so this might make <code>rust-analyzer</code> a tiny bit faster</p>



<a name="192180127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192180127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192180127">(Mar 29 2020 at 15:39)</a>:</h4>
<p>I'm surprised that gnome builder doesn't support <code>Full</code> mode since that sounds easier to implement. I wonder if there's an option.</p>



<a name="192182952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192182952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192182952">(Mar 29 2020 at 16:40)</a>:</h4>
<p>Maybe they wanted to implement the most efficient mode first instead of the easiest, as they would likely want to implement the most efficient mode at some point anyway.</p>



<a name="192185252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192185252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192185252">(Mar 29 2020 at 17:34)</a>:</h4>
<blockquote>
<p>Well, it looks like Code sends an update on each keypress so this might make rust-analyzer a tiny bit faster</p>
</blockquote>
<p>They actually, for a full-sync mode, have a debouncing rate inside of the editor</p>



<a name="192186021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192186021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192186021">(Mar 29 2020 at 17:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="133169">matklad</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192185252" title="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/rust-analyzer.20in.20gnome-builder/near/192185252">said</a>:</p>
<blockquote>
<p>They actually, for a full-sync mode, have a debouncing rate inside of the editor</p>
</blockquote>
<p>Strange, am I typing too slow? :-). I didn't notice any debouncing.</p>



<a name="192187280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192187280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192187280">(Mar 29 2020 at 18:23)</a>:</h4>
<p><a href="https://github.com/microsoft/vscode-languageserver-node/blob/b1f6a443efad3d61cf83344589099dab5318ca66/client/src/client.ts#L1003-L1029" title="https://github.com/microsoft/vscode-languageserver-node/blob/b1f6a443efad3d61cf83344589099dab5318ca66/client/src/client.ts#L1003-L1029">https://github.com/microsoft/vscode-languageserver-node/blob/b1f6a443efad3d61cf83344589099dab5318ca66/client/src/client.ts#L1003-L1029</a></p>



<a name="192187465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/192187465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#192187465">(Mar 29 2020 at 18:27)</a>:</h4>
<p><a href="/user_uploads/4715/_UJtJrRVYpS4NrbQdENFWttF/image.png" title="image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/_UJtJrRVYpS4NrbQdENFWttF/image.png" title="image.png"><img src="/user_uploads/4715/_UJtJrRVYpS4NrbQdENFWttF/image.png"></a></div>



<a name="195940712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer%20in%20gnome-builder/near/195940712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rust-analyzer.20in.20gnome-builder.html#195940712">(May 01 2020 at 08:25)</a>:</h4>
<p><span class="user-mention" data-user-id="278750">@bronze alibi</span> not sure if you've been following that GitHub issue, but Builder should be supported in the latest nightly. There are some instructions here: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4236/files" title="https://github.com/rust-analyzer/rust-analyzer/pull/4236/files">https://github.com/rust-analyzer/rust-analyzer/pull/4236/files</a>. Testing it would be welcome :-).</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>